/**
 * 
 */
package com.seedwill.common.meta.result;

import java.util.List;

/**
 * Route Message Result
 * @author kdyi
 *
 */
public class MessageRouteResult extends MessageResult {
	
	/**
	 * 环境设定
	 */
	protected Object context;
	
	public static MessageRouteResult defaultSucessResult(){
		return new MessageRouteResult(true);
	}
	public static MessageRouteResult defaultFailResult(){
		return new MessageRouteResult(false);
	}
	/**
	 * 继续执行的标识
	 */
	private boolean continueRoute;

	/**
	 * 
	 */
	public MessageRouteResult() {
		super();
	}

	/**
	 * @param f
	 */
	public MessageRouteResult(boolean f) {
		super(f);
		setContinueRoute(f);
	}

	/**
	 * @param f
	 * @param rtn
	 */
	public MessageRouteResult(boolean f, Object rtn) {
		super(f, rtn);
		setContinueRoute(f);
	}

	/**
	 * @param f
	 * @param rtn
	 * @param msg
	 */
	public MessageRouteResult(boolean f, Object rtn, String msg) {
		super(f, rtn, msg);
		setContinueRoute(f);
	}

	/**
	 * @param f
	 * @param rtn
	 * @param msg
	 * @param aMessages
	 */
	public MessageRouteResult(boolean f, Object rtn, String msg, List aMessages) {
		super(f, rtn, msg, aMessages);
		setContinueRoute(f);
	}
	
	/**
	 * @param f
	 * @param rtn
	 * @param msg
	 * @param cf
	 */
	public MessageRouteResult(boolean f, Object rtn, String msg, boolean continueF) {
		super(f, rtn, msg);
		setContinueRoute(continueF);
	}

	public boolean isContinueRoute() {
		return continueRoute;
	}

	public void setContinueRoute(boolean continueRoute) {
		this.continueRoute = continueRoute;
	}

	public static MessageRouteResult startRouteResult() {
		MessageRouteResult mrr = new MessageRouteResult(true);
		//TODO 准备初始化结果
		return mrr;
	}
	public Object getContext() {
		return context;
	}
	public void setContext(Object context) {
		this.context = context;
	}

}
